//小乐乐改数字
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            StringBuilder str = new StringBuilder();
            while (a != 0) {
                str.append((a%10)%2);
                a /= 10;
            }
            String s = str.toString();
            int i = s.length()-1;
            while (i > 0 && s.charAt(i) == '0') {
                i--;
            }
            for (; i >= 0; i--) {
                System.out.print(s.charAt(i));
            }
            System.out.println();
        }
    }
}
import java.util.*;
public class Bonus {
public int getMost(int[][] board) {
// write code here
for (int i = 1; i < 6; i++) {
board[0][i] = board[0][i] + board[0][i-1];
}
for (int i = 1; i < 6; i++) {
board[i][0] = board[i][0] + board[i-1][0];
}
for (int i = 1; i < 6; i++) {
for (int j = 1; j < 6; j++) {
board[i][j] += Math.max(board[i][j-1], board[i-1][j]);
}
}
return board[5][5];
}
}


import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    static class Node {
        int x;
        int y;
        public Node(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int m = in.nextInt();
            int[][] arr = new int[n][m];

            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    arr[i][j] = in.nextInt();
                }
            }
            List<Node> list = new ArrayList<>();
            List<Node> minList = new ArrayList<>();
            boolean[][] isSame = new boolean[n][m];

            migong(list, minList, 0, 0, arr, isSame);
            for (Node node : minList) {
                System.out.println("("+node.x+","+node.y+")");
            }

        }
    }

    public static void migong(List<Node> list, List<Node> minList, int x,
    int y, int[][] arr, boolean[][] isSame) {
        if (x < 0 || x >= arr.length || y < 0 || y >= arr[0].length || 
        isSame[x][y] == true || arr[x][y] == 1) {
            return;
        }

        Node node = new Node(x, y);
        list.add(node);
        isSame[x][y] = true;
        if (x == arr.length-1 && y == arr[0].length-1) {
            if (minList.isEmpty() || minList.size() > list.size()) {
                minList.addAll(list);
            }
            list.remove(list.size()-1);
            isSame[x][y] = false;
            return;
        }
        migong(list, minList, x+1, y, arr, isSame);
        migong(list, minList, x-1, y, arr, isSame);
        migong(list, minList, x, y+1, arr, isSame);
        migong(list, minList, x, y-1, arr, isSame);
        list.remove(list.size()-1);
        isSame[x][y] = false;
    }
}










